<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../style/css/layout.css" rel="stylesheet" type="text/css" />
<link href="../style/css/font.css" rel="stylesheet" type="text/css" />
<title>Personal Index</title>
</head>

<body>
<?php
   @session_start();
	$typeRole_Visitor = 0;//判断登陆的用户是企业用户还是毕业生用户
	$companyId_Visited = 0;
	//判断是否登录
	if((!isset($_SESSION["Company_Id"]) || $_SESSION["Company_Id"] == null))
	{
		//非企业用户
		if(!isset($_SESSION["Graduate_Id"]) || $_SESSION["Graduate_Id"] == null)
		{
			/*非毕业生用户、未登录*/
			echo '<script>alert("请登录再进呐~~ ");window.location.href="../pages/login.php";</script>';
			exit();
		}
		else
		{
			$typeRole_Visitor = 1;//1代表毕业生用户
		}
	}
	else
	{
		//企业用户
		$typeRole_Visitor = 2;//2代表企业用户
	}
	/*已经登录*/
	//通过地址获取公司的id
	if(!isset($_GET["companyId"]) || $_GET["companyId"] == null)
	{
		//地址中并没有公司id
		//echo '<script>alert("'.$_GET["companyId"].'");</script>';
		if($typeRole_Visitor == 1)
		{
			//毕业生用户，跳到毕业生用户自己的主页
			echo '<script>window.location.href="../personal/index.php";</script>';
		}
		else if($typeRole_Visitor == 2)
		{
			//公司用户，则把被访问的公司id的默认改为本公司的id
			$companyId_Visited = (int)$_SESSION["Company_Id"];
		}
		else
		{
			//什么都不是
			echo '<script>alert("请登录再进呐~~ ");window.location.href="../pages/login.php";</script>';
			exit();
		}
	}
	else
	{
		//已经登录，且地址栏中含有被访问的公司id
		$companyId_Visited = $_GET["companyId"];
	}
	
	include("../class/company.class.php");
	include("../class/employ_message.class.php");
	$user = new Company();
	$user->GetUserDataById($companyId_Visited);
	
	$message = new EmployMessage();//招聘信息
	
	require("../inc/top.php");
?>

<div class="mainpage_contain">
	<div class="mainpage_nav">
    	<div class="mainpage_title"><?php echo $user->companyName;?>企业的主页</div>
        <div class="mainpage_tab_contain">
            <?php  include("inc/tabs.php"); ?>
        </div>
    </div>
    
    <div class="mainpage_body">
    	<div class="mainpage_left">
        
        	<!--<div class="select_job_contain">
            	<div class="select_job_bar">
            		<div class="select_job_l">按地区</div>
                    <div class="select_job_r on">宁波</div>
                    <div class="select_job_r">杭州</div>
                    <div class="select_job_r">萧山</div>
                    <div class="select_job_r">温州</div>
                    <div class="select_job_r">嘉兴</div>
                    <div class="select_job_r">绍兴</div>
                    <div class="clear"></div>
                </div>
                <div class="select_job_bar_border"></div>
                <div class="select_job_bar">
            		<div class="select_job_l">按行业</div>
                    <div class="select_job_r on">计算机</div>
                    <div class="select_job_r">营销</div>
                    <div class="select_job_r">管理</div>
                    <div class="select_job_r">策划</div>
                    <div class="select_job_r">销售</div>
                    <div class="select_job_r">开发</div>
                    <div class="clear"></div>
                </div>
                <div class="select_job_bar_border"></div>
                <div class="select_job_bar">
            		<div class="select_job_l">按专业</div>
                    <div class="select_job_r">自动化</div>
                    <div class="select_job_r on">经济管理</div>
                    <div class="select_job_r">海洋科学</div>
                    <div class="select_job_r">通信</div>
                    <div class="select_job_r">国际金融管理</div>
                    <div class="clear"></div>
                </div>
                <div class="select_job_bar_border"></div>
                <div class="select_job_bar">
            		<div class="select_job_l">按薪酬</div>
                    <div class="select_job_r">1000以下</div>
                    <div class="select_job_r">1000-2000</div>
                    <div class="select_job_r on">2000-3000</div>
                    <div class="select_job_r">3000-4000</div>
                    <div class="select_job_r">4000-5000</div>
                    <div class="select_job_r">5000以上</div>
                    <div class="clear"></div>
                </div>
                <div class="select_job_bar_border"></div>
                <div class="select_job_bar">
            		<div class="select_job_l">按类别</div>
                    <div class="select_job_r on">全职</div>
                    <div class="select_job_r">实习</div>
                    <div class="clear"></div>
                </div>
            </div>-->
            <?php  $num_page = (int)$_GET["page"];
					if($num_page == null) $num_page = 1;
					echo  $message->GetMessageByCId($num_page,$companyId_Visited);?>
            
        	<!-- <div class="Recruitment_list_contain">
            	<div class="Recruitment_list_name"><a href="Recruitment_detail.php?id=<?php echo $message->id?>"></><?php echo $message->title?></a></div>
                <div class="Recruitment_list_position">职位名称：<span class="fc333">
                 <?php if($message->job_attribute==1)echo $message->position,"(全职)";
                	         else if($message->job_attribute==2) echo $message->position,"(实习)";?></span></div>
                <div class="Recruitment_list_location">工作地点：<span class="fc333"><?php echo $message->place?></span></div>
                <div class="Recruitment_list_endtime">薪资待遇：<span class="fc333"><?php echo $message->payment?></span></div>
                <div class="Recruitment_list_sep"></div>
				<div class="clear"></div>
            </div>
             -->
       
           <!-- <div class="Recruitment_list_contain">
            	<div class="Recruitment_list_name">中国移动设计院北京分公司2012招聘</div>
                <div class="Recruitment_list_position">职位名称：<span class="fc333">信息传播分析师 (全职)</span></div>
                <div class="Recruitment_list_location">工作地点：<span class="fc333">北京</span></div>
                <div class="Recruitment_list_endtime">薪资待遇：<span class="fc333">RMB 3500/月</span></div>
                <div class="Recruitment_list_sep"></div>
                <div class="Recruitment_list_position">职位名称：<span class="fc333">产品推广经理 (全职)</span></div>
                <div class="Recruitment_list_location">工作地点：<span class="fc333">北京</span></div>
                <div class="Recruitment_list_endtime">薪资待遇：<span class="fc333">RMB 3500/月</span></div>
                <div class="Recruitment_list_sep"></div>
                <div class="Recruitment_list_position">职位名称：<span class="fc333">漏洞分析工程师 (全职)</span></div>
                <div class="Recruitment_list_location">工作地点：<span class="fc333">北京</span></div>
                <div class="Recruitment_list_endtime">薪资待遇：<span class="fc333">RMB 3500/月</span></div>
                <div class="clear"></div>
            </div>
            
            <div class="Recruitment_list_contain">
            	<div class="Recruitment_list_name">中国移动设计院北京分公司2012招聘</div>
                <div class="Recruitment_list_position">职位名称：<span class="fc333">信息传播分析师 (全职)</span></div>
                <div class="Recruitment_list_location">工作地点：<span class="fc333">北京</span></div>
                <div class="Recruitment_list_endtime">薪资待遇：<span class="fc333">RMB 3500/月</span></div>
                <div class="Recruitment_list_sep"></div>
                <div class="Recruitment_list_position">职位名称：<span class="fc333">产品推广经理 (全职)</span></div>
                <div class="Recruitment_list_location">工作地点：<span class="fc333">北京</span></div>
                <div class="Recruitment_list_endtime">薪资待遇：<span class="fc333">RMB 3500/月</span></div>
                <div class="Recruitment_list_sep"></div>
                <div class="Recruitment_list_position">职位名称：<span class="fc333">漏洞分析工程师 (全职)</span></div>
                <div class="Recruitment_list_location">工作地点：<span class="fc333">北京</span></div>
                <div class="Recruitment_list_endtime">薪资待遇：<span class="fc333">RMB 3500/月</span></div>
                <div class="clear"></div>
            </div>
            -->
            <div class="h10px"></div>
            <!--页码-->
            <div class="page_contain">
            	<?php
				$num_page = (int)$_GET["page"];
					if($num_page == null || $num_page<1) $num_page = 1;	   
            	$message->Show_pagelist($num_page,$companyId_Visited,"Recruitment_list.php?page=");?>
            	<!--  <div class="page_box" onclick="location.href='?page=pre';">上一页</div>
            	<div class="page_box" onclick="location.href='?page=1';">1</div>
                <div class="page_box">2</div>
                <div class="page_box">3</div>
                <div class="page_box">4</div>
                <div class="page_box">5</div>
                <div class="page_box">6</div>
                <div class="page_box">7</div>
                <div class="page_box">8</div>
                <div class="page_box">9</div>
                <div class="page_box">10</div>
                <div class="page_box">下一页</div>-->
            	<div class="clear"></div>
            </div>
	 	</div>
        
        <div class="mainpage_right">
        	<?php  require("inc/left_intro.php"); ?>
        </div>
        <div class="clear"></div>
    </div>
</div>

<?php
	require("../inc/copyright.php");
?>
</body>
</html>